<div class="row">
	<div class="col-xs-12 col-sm-12 col-md-12 col-lg-4">
		<h1 class="page-title txt-color-blueDark"><i class="fa-fw fa fa-user"></i> {:W('Nav/navTop')}
		<span>
		<a class="btn btn-primary" href="#/index.php?m=admin&c=role&a=index"><i class="fa fa-eye "></i>&nbsp;&nbsp;{:L('user_role_list')}</a>
		</span>
		</h1>
		
	</div>
</div>
	<!-- row -->
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
						<div class="well no-padding">
<div class="widget-body-toolbar hidden-xs">
						</div>
	<table id='user_table' class="table table-striped table-hover dataTable text-align-center">
							<thead>
								<tr>
									<th class="text-align-center hidden-xs">ID</th>
									<!-- <th>{:L('user_pic')}</th> -->
									<th class="text-align-center">{:L('user_name')}</th>
									<th class="text-align-center">{:L('user_phone')}</th>
									<th class="text-align-center">{:L('user_status')}</th>
									<th class="text-align-center hidden-xs">{:L('user_department')}</th>
									<th class="text-align-center hidden-xs">{:L('user_leader')}</th>
									<th class="text-align-center hidden-xs">{:L('user_role')}</th>
									<th class="text-align-center hidden-xs">{:L('user_last_ip')}</th>
									<th class="text-align-center hidden-xs">{:L('user_last_time')}</th>
									<th class="text-align-center"> </th>
								</tr>
							</thead>
							<tbody>	
							</tbody>	
		</table>
	</div>
	</div>
	</div>

<script src="js/plugin/datatables/jquery.dataTables-cust.min.js"></script>
<script src="js/plugin/datatables/ColReorder.min.js"></script>
<script src="js/plugin/datatables/FixedColumns.min.js"></script>
<script src="js/plugin/datatables/ColVis.min.js"></script>
<script src="js/plugin/datatables/ZeroClipboard.js"></script>
<script src="js/plugin/datatables/media/js/TableTools.min.js"></script>
<script src="js/plugin/datatables/DT_bootstrap.js"></script>
	<script>
	role_id = "{:I('get.role_id')}";
	if(role_id){
		param = '&role_id='+role_id;
	}else{
		param = '';
	}
	$.getJSON('{:U("User/index")}','data=1'+param, function (data) {
		var rs = eval(data.content);
		var table_array = new Array();
		for(var i=0; i<rs.length; i++)
		{
			///meau = '<div data-sparkline-piesize="23px" data-sparkline-offset="90" data-sparkline-piecolor="[&quot;#E979BB&quot;, &quot;#57889C&quot;]" data-sparkline-type="pie" class="sparkline display-inline"><canvas style="display: inline-block; width: 23px; height: 23px; vertical-align: top;" width="23" height="23"></canvas></div><div class="btn-group display-inline pull-right text-align-left hidden-tablet"><button data-toggle="dropdown" class="btn btn-xs btn-default dropdown-toggle"><i class="fa fa-cog fa-lg"></i></button><ul class="dropdown-menu dropdown-menu-xs pull-right"><li><nav class="text-align-center"><a href="{:U(\'User/userEdit?id='+rs.i.userid+'\')}"><i class="fa fa-edit fa-lg fa-fw txt-color-greenLight"></i> {:L(\'user_edit\')}</a></nav></li><li><a href="javascript:void(0);"><i class="fa fa-wrench fa-lg fa-fw txt-color-black"></i> {:L(\'user_permissions_edit\')}</a></li><li class="divider"></li><li class="text-align-center"><a href="javascript:void(0);">{:L(\'cms_cancel\')}</a></li></ul></div>';
            edit = '<a href="#{$Think.config.SUB_PATH}index.php?m=admin&c=user&a=useredit&id='+rs[i].userid+'" title="{:L(\'user_edit\')}"><i class="fa fa-edit fa-lg fa-fw txt-color-blue"></i></a>';
			if(rs[i].status==1){
				status = '<span class="txt-color-green">{:L(\'user_status_1\')}</span>';
			}else{
				status = '<span class="txt-color-red">{:L(\'user_status_0\')}</span>';
			}
			
			//判断语言
			if(rs[i].role)
			{
				if( $.cookie('think_language')=="zh-cn" )
				{
					role = rs[i].role.name;
				}else{
					role = rs[i].role.en_name;
				}
			}else{
				role ='';
			}
			
			table_array.push
			( [
					rs[i].userid,
					rs[i].real_name,
					rs[i].phone_num,
					status,
					rs[i].department,
					rs[i].leader,
					role,
					rs[i].lastloginip,
					rs[i].lastlogintime,
					edit
			]);
		}
		var langage=	
		{                          
			"sZeroRecords": "{:L("sZeroRecords")}",
			"sInfo": "{:L("sInfo")}",
			"sInfoEmtpy": "{:L("sInfoEmtpy")}",
			"sProcessing": "{:L("sProcessing")}",
			"oPaginate": 
			{
				"sFirst": "{:L("sFirst")}",
				"sPrevious": "{:L("sPrevious")}",
				"sNext": "{:L("sNext")}",
				"sLast": "{:L("sLast")}"
			}
		};
		$('#user_table').dataTable( 
		{
					"sDom" : "<'dt-top-row hidden-xs'Tlf>r<'dt-wrapper't><'dt-row dt-bottom-row'<'row'<'col-sm-6'i><'col-sm-6 text-right'p>>",
					"oTableTools" : 
					{
						"aButtons" : ["copy", "print", 
						              {
										"sExtends" : "collection",
										"sButtonText" : 'Save <span class="caret" />',
										"aButtons" : ["csv", "xls", "pdf"]
									  }
									 ],
						"sSwfPath" : "js/plugin/datatables/media/swf/copy_csv_xls_pdf.swf"
					},
					"aaData": table_array,
					"iDisplayLength": 50,
					"bInfo":true,
					"bFilter":true,
					"bSort":false,
					"bPaginate":true,
					"bLengthChange":true,
					"bProcessing": true,
					"bStateSave":true,
					"bDestroy": true,
					"oLanguage": langage,
					"aoColumns":
					[
					             {"sClass": "hidden-xs" },
					             {"stitle": "" },
					             {"stitle": "" },
					             {"stitle": ""},
					             {"sClass": "hidden-xs" },
					             {"sClass": "hidden-xs" },
					             {"sClass": "hidden-xs" },
					             {"sClass": "hidden-xs" },
					             {"sClass": "hidden-xs" },
					             {"stitle": ""}
					 ]
					
			        
		}); 
	});
	</script>
